package com.xiaoq.shop.service;

import com.xiaoq.shop.entity.SKUEntity;
import com.xiaoq.vo.PagingVo;

import java.util.List;
import java.util.Map;

/**
 * Created by chenjh on 2017/11/3.
 */
public interface ISKUService {

    /**
     *  根据店Id 以及 规格 获取 票 SKU 列表
     * @param shopId
     * @return
     */
    List<SKUEntity> getTicketSkuList(String shopId, PagingVo pagingVo, Integer saleStatus);

    /**
     *
     * @param shopId 店的
     * @param pagingVo 分页参数
     * @param saleStatus 见ConstantUtil
     * @return 总数量
     */
    long getTicketSkuListCount(String shopId, PagingVo pagingVo, Integer saleStatus);

    /**
     *
     * @param shopId 店ID
     * @return Map<String, List<SKUEntity>> key:specificationName value:SKUEntity List
     */
    Map<String, List<SKUEntity>> getTicketSkuMap(String shopId, PagingVo pagingVo, Integer saleStatus);


    /**
     * @param shopId 店ID
     * @param spuCode spu id
     * @param skuCode sku id
     * @return
     */
    SKUEntity getTicketSku(String shopId, String spuCode, String skuCode);

    /**
     *  根据skuId 获取门票信息
     * @param skuId
     * @return
     */
    SKUEntity getTicketSkuById(String skuId);

    /**
     * 　根据景区ID和讲解员ID 获取SKU
     * @param shopId 商店（或景区）ID
     * @param interpreterId 讲解员ID
     * @return
     */
    SKUEntity getInterpreterSkuById(String shopId, String interpreterId);

    /**
     * 保存skuEntity
     * @param skuEntity
     * @return
     */
    boolean save(SKUEntity skuEntity);

    /**
     *
     * @param shopId 店ID
     * @param spuName spu名称
     * @param specifications 规格
     * @return
     */
    SKUEntity findTicketSku(String shopId, String spuName, String specifications);

    /**
     *  根据skuId 更新SKUEntity
     * @param skuEntity
     * @return
     */
    boolean updateSkuById(SKUEntity skuEntity);

    /**
     *  根据shopId和spuCode 获取SKUEntity List
     * @param shopId 店ID
     * @param spuCode spuCode
     * @param saleState 上架/下架
     * @return
     */
    List<SKUEntity> getSkuList(String shopId, String spuCode,Integer saleState);

    /**
     * 根据讲解员ID和shopId删除SKU
     * @param interId 讲解员Id
     * @param shopId 店Id
     * @return
     */
    boolean deleteByInterIdAndShopId(String interId, String shopId);

    /**
     *  根据shopId和spuCodeList 获取SKUEntity List
     * @param shopId 店ID
     * @param spuCodeList spuCode String List
     * @param saleState 上架/下架
     * @return
     */
    List<SKUEntity> getSkuList(String shopId, List<String> spuCodeList, Integer saleState);

    /**
     *  根据shopId和skuIdList 修改saleState状态
     * @param shopId 店ID
     * @param skuIdList skuId String List
     * @param saleState 上架/下架( 见ConstantUtil)
     * @return
     */
    boolean updateSkuSaleStateByShopIdAndSkuIds(String shopId, List<String> skuIdList, Integer saleState);


    /**
     * 根据 shopId skuIdList删除
     * @param shopId 店ID
     * @param skuIdList shuId List
     * @return
     */
    boolean deleteSkuByShopIdAndSkuIds(String shopId, List<String> skuIdList);

}
